/*
 * @(#)MaintWorkflowGroupForm.java
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of DCIVision
 * Ltd ("Confidential Information").  You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the license
 * agreement you entered into with DCIVision Ltd.
 */
package com.dcivision.workflow.web;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;

import com.dcivision.framework.ApplicationException;
import com.dcivision.framework.TextUtility;
import com.dcivision.framework.bean.AbstractBaseObject;
import com.dcivision.workflow.bean.WorkflowGroup;

/**
  MaintWorkflowGroupForm.java

  This class is the for web form purpose.

  @author          zealot Shi
  @company         DCIVision Limited
  @creation date   29/07/2003
  @version         $Revision: 1.2 $
*/

public class MaintWorkflowConnectionForm extends com.dcivision.setup.web.AbstractActionPermissionForm {

  public static final String REVISION = "$Revision: 1.2 $";

  private String workflowChart = null;
  private String[] parentStepSeq = null;
  private String[] childStepSeq = null;
  private String[] parentStepType = null;
  private String[] parentStepActionType = null;
  private String[] stepSeq = null;
  private String[] loopBack = null;
  private String workflowRecordID = null;
  public MaintWorkflowConnectionForm() {
    super();
  }
  
  public String getWorkflowChart() {
    return(this.workflowChart);
  }

  public void setWorkflowChart(String workflowChart) {
    this.workflowChart = workflowChart;
  }
  
  public String getWorkflowRecordID() {
    return(this.workflowRecordID);
  }

  public void setWorkflowRecordID(String workflowRecordID) {
    this.workflowRecordID = workflowRecordID;
  }
  
  public String[] getParentStepSeq() {
    return(this.parentStepSeq);
  }

  public void setParentStepSeq(String[] parentStepSeq) {
    this.parentStepSeq = parentStepSeq;
  }
  
  public String[] getChildStepSeq() {
    return(this.childStepSeq);
  }

  public void setChildStepSeq(String[] childStepSeq) {
    this.childStepSeq = childStepSeq;
  }
  
  public String[] getStepSeq() {
    return(this.stepSeq);
  }

  public void setStepSeq(String[] stepSeq) {
    this.stepSeq = stepSeq;
  }
  
  public String[] getParentStepType() {
    return(this.parentStepType);
  }

  public void setParentStepType(String[] parentStepType) {
    this.parentStepType = parentStepType;
  }
  
  public String[] getParentStepActionType() {
    return(this.parentStepActionType);
  }

  public void setParentStepActionType(String[] parentStepActionType) {
    this.parentStepActionType = parentStepActionType;
  }
  
  public String[] getLoopBack() {
    return(this.loopBack);
  }

  public void setLoopBack(String[] loopBack) {
    this.loopBack = loopBack;
  }

  
  public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
    return super.validate(mapping, request);
  }

  public void reset(ActionMapping mapping, HttpServletRequest request) {
    super.reset(mapping, request);
    this.setID(null);
    this.setRecordStatus(null);
    this.setUpdateCount(null);
    this.setCreatorID(null);
    this.setCreateDate(null);
    this.setUpdaterID(null);
    this.setUpdateDate(null);
  }

  public AbstractBaseObject getFormData() throws ApplicationException {
    WorkflowGroup tmpWorkflowGroup = new WorkflowGroup();
    tmpWorkflowGroup.setID(TextUtility.parseIntegerObj(this.getID()));
    tmpWorkflowGroup.setRecordStatus(this.getRecordStatus());
    tmpWorkflowGroup.setUpdateCount(TextUtility.parseIntegerObj(this.getUpdateCount()));
    tmpWorkflowGroup.setCreatorID(TextUtility.parseIntegerObj(this.getCreatorID()));
    tmpWorkflowGroup.setCreateDate(parseTimestamp(this.getCreateDate()));
    tmpWorkflowGroup.setUpdaterID(TextUtility.parseIntegerObj(this.getUpdaterID()));
    tmpWorkflowGroup.setUpdateDate(parseTimestamp(this.getUpdateDate()));
    return tmpWorkflowGroup;
  }

  public void setFormData(AbstractBaseObject baseObj) throws ApplicationException {
    WorkflowGroup tmpWorkflowGroup = (WorkflowGroup)baseObj;
    this.setID(TextUtility.formatIntegerObj(tmpWorkflowGroup.getID()));
    this.setRecordStatus(tmpWorkflowGroup.getRecordStatus());
    this.setUpdateCount(TextUtility.formatIntegerObj(tmpWorkflowGroup.getUpdateCount()));
    this.setCreatorID(TextUtility.formatIntegerObj(tmpWorkflowGroup.getCreatorID()));
    this.setCreateDate(formatTimestamp(tmpWorkflowGroup.getCreateDate()));
    this.setUpdaterID(TextUtility.formatIntegerObj(tmpWorkflowGroup.getUpdaterID()));
    this.setUpdateDate(formatTimestamp(tmpWorkflowGroup.getUpdateDate()));
  }
}
